package com.ruoyi.system.api;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.system.api.factory.RemoteDictFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(contextId = "IRemoteDictService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDictFallbackFactory.class)
public interface RemoteDictService {
    /**
     * 根据字典类型和字典值获取字典标签
     *
     * @return 字典标签
     */
    @PostMapping(value = "/remote/dict/getDictLabel")
    String getDictLabel(@RequestBody JSONObject inParam);

    /**
     * 根据字典类型和字典标签获取字典值
     * @return 字典值
     */
    @RequestMapping(value = "/remote/dict/getDictValue")
    String getDictValue(@RequestBody JSONObject inParam);
}
